import React from 'react'
import ZxHoc from '../ZxHoc/ZxHoc'
import './ZxActive.css'
import ZxActiveBtn from '../../component/ZxModal/ZxActiveBtn'

class ZxActiveText extends React.Component{
    constructor(props){
        super(props)
        this.myRef=React.createRef
    }
    componentDidMount(){
        let {item,initValueSet}=this.props
        initValueSet(item.active_money1,item.active_money2,item.active_id,item.shop_id)
        console.log('=============================================123');
        if(this.props.onRef){
           this.props.onRef(this)
        }
    }
   
  
   /*  componentDidUpdate(prevProps,prevState){
        // this.toParent()
    } */
    render(){
        let {activeDidMoney,activeCutMoney,activeId,shopIdValue,Change}=this.props
        // console.log(activeDidMoney);
        // console.log(this.props.parent);
        return(
            <div className='formActive' ref={this.myRef}>
                    {/* <h3>满减活动</h3> */}
                    <label>
                    <span>{activeId}</span> 
                   满：<input type="text" 
                                className='activeInput'
                                onChange={Change('activeDidMoney')}
                                value={activeDidMoney}/>
                    </label>
                    <label>
                        减：<input type="text"
                                 className='activeInput'
                                 value={activeCutMoney}
                                 onChange={Change('activeCutMoney')}
                            />
                    </label>
                    <ZxActiveBtn {...this.props} ></ZxActiveBtn>
            </div>
            
        )
    }
}

export default ZxHoc(ZxActiveText)